
import { Navigate } from 'react-router-dom';
import {FC} from 'react'
const RequireAuth:FC<any>=({children,path,title}):JSX.Element=>{
    document.title=`${title.title}-访客系统`
    return (
        (sessionStorage.getItem("token") || path==="/login") ? children : <Navigate to="/login" />
    )
}

export default RequireAuth;